<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Form Test</title>
<link rel="stylesheet" href="../css/form5.css" type="text/css" />

<script type="text/javascript" src="../liwe.js"></script>
<script type="text/javascript" src="../ajax_manager.js"></script>
<script type="text/javascript" src="../locale.js"></script>
<script type="text/javascript" src="../utils.js"></script>
<script type="text/javascript" src="../string_enh.js"></script>
<script type="text/javascript" src="../types.js"></script>
<script type="text/javascript" src="../form5.js"></script>
<script type="text/javascript" src="../validators.js"></script>
<script type="text/javascript" src="../event_manager.js"></script>

<script type="text/javascript">

var model = {
	fields : [
		{
			type: "text",
			name: "document_text",
			label: "Testo",
			size: 10,
			"data-mode": "FULTXT"
		},
		{
			type: "submit",
			name: "submit",
			value: "Cerca"
		}
	],
	template : "%(form-start)s" +
		"<div>%(document_text-label)s: %(document_text)s</div>" +
		"%(submit)s" +
		"%(form-end)s"
};

function create_form ()
{
	liwe._libbase = "../";
	
	var f = new liwe.form5.from_model ( "test", null, model );

	f.addEventListener ( 'submit', function ()
	{
		alert ( 'Invio...' );
		return false;
	} );

	f.set ( 'my_form' );
}

</script>
</head> 
<body onload="create_form()">

<h2>Form 1</h2>
<div id="my_form"></div>

</body>
</html>
